package com.yang.springbootDemo.controller;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yang.springbootDemo.dao.UserMapper;
import com.yang.springbootDemo.entity.UserEntity;

@Controller
@SpringBootApplication
@RequestMapping("user/")
public class UserController {

	@Autowired
	private UserMapper userMapper;
	
	@RequestMapping("getUser")
	@ResponseBody
	public Object getUser(String name){
		UserEntity user =null;
		if(StringUtils.isNotBlank(name)){
			user = userMapper.getUser(name);
		}
		return user;
	} 
	
}
